﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace welding
{
    public partial class SystemConfigLogin : Form
    {
        public SystemConfigLogin()
        {
            InitializeComponent();
        }
        private string pwd;
        public SystemConfigLogin(string pwd)
        {
            InitializeComponent();
            this.pwd = pwd;
        }

        private void SystemConfigLogin_Load(object sender, EventArgs e)
        {
            lblSystemConfigLoginInfo.Text = "";
        }

        private void btnSystemConfigLogin_Click(object sender, EventArgs e)
        {
            if(tbSystemConfigPwd.Text==pwd)
            {
                DialogResult = DialogResult.OK;
                this.Close();
            }
            else
            {
                lblSystemConfigLoginInfo.Text = "密码错误";
            }
        }

        private void tbSystemConfigPwd_KeyPress(object sender, KeyPressEventArgs e)
        {
            {
                if (e.KeyChar == (char)Keys.Enter)
                {
                    btnSystemConfigLogin.Focus();
                }
            }
        }

        private void btnSystemConfigLoginCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
